Skip to content

Conversation

@ethcipher
Copy link

Description

This PR adds two new config options to patch the WebRTC IP leaks:

  • disable_webRTC (default: True)
    Stops WebRTC from leaking your real IP address when using a proxy.
    Behind the scenes, this sets:
  • --webrtc-ip-handling-policy=disable_non_proxied_udp
  • --force-webrtc-ip-handling-policy

Tested against browserleaks.com/webrtc no leaks after the patch

1 - this before the patch or now when disable_webRTC=False
photo_2025-09-28_11-09-15

2 - this after the patch and when disable_webRTC=True
photo_2025-09-28_11-09-22

  • disable_webGL (default: False)
    Turns off WebGL (--disable-webgl, --disable-webgl2).
    This helps reduce fingerprinting since WebGL exposes GPU details. The Tor Browser disables WebGL for exactly this reason; the option is False. By default, you can enable it as shown in the example usage below.

Example usage

import zendriver as zd

config = zd.Config(
  disable_webRTC=True, # True by default
  disable_webGL=True   # False by default
)

Pre-merge Checklist

  • I have described my change in the section above.
  • I have ran the ./scripts/format.sh and ./scripts/lint.sh scripts. My code is properly formatted and has no linting errors.
  • I have ran uv run pytest and ensured all tests pass.
  • I have added my change to CHANGELOG.md under the [Unreleased] section.

@ethcipher ethcipher requested a review from a team as a code owner September 28, 2025 10:13
@stephanlensky
Copy link
Member

Hey @ethcipher, thanks for the contribution! I'm traveling right now and don't have a computer with me, but my initial thought is this looks great. I'll do a final review so we can get this merged when I return in a few weeks.

Copy link
Member

@stephanlensky stephanlensky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again for the change and for your patience, everything looks great. Just a couple of minor comments and I can get this merged 🙂

### Removed


## [0.14.3] - 2025-09-28
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add changes under the [Unreleased] section, my release script will create a section for the new release automatically.

browser_connection_max_tries: int = 10,
user_agent: Optional[str] = None,
disable_webRTC: Optional[bool] = True,
disable_webGL: Optional[bool] = False,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super nit: let's call these disable_webrtc and disable_webgl

@codecov
Copy link

codecov bot commented Oct 19, 2025

Codecov Report

❌ Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
zendriver/core/config.py 83.33% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants